Optimal. Leaf size=196 \[ -\frac{d^2 n \log (d+e x) \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{2 e^2}+\frac{d n (d+e x) \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{e^2}-\frac{n (d+e x)^2 \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{4 e^2}+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (g \log \left (c (d+e x)^n\right )+f\right )+\frac{b d^2 g n^2 \log ^2(d+e x)}{2 e^2}+\frac{b g n^2 (d+e x)^2}{4 e^2}-\frac{2 b d g n^2 x}{e} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.370905, antiderivative size = 206, normalized size of antiderivative = 1.05, number of steps used = 13, number of rules used = 7, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.233, Rules used = {2439, 2411, 43, 2334, 12, 14, 2301} \[ \frac{1}{4} g n \left (-\frac{2 d^2 \log (d+e x)}{e^2}+\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (g \log \left (c (d+e x)^n\right )+f\right )+\frac{1}{4} b n \left (-\frac{2 d^2 \log (d+e x)}{e^2}+\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}\right ) \left (g \log \left (c (d+e x)^n\right )+f\right )+\frac{b d^2 g n^2 \log ^2(d+e x)}{2 e^2}+\frac{b g n^2 (d+e x)^2}{4 e^2}-\frac{2 b d g n^2 x}{e} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2439
Rule 2411
Rule 43
Rule 2334
Rule 12
Rule 14
Rule 2301
Rubi steps
\begin{align*} \int x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx &=\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac{1}{2} (b e n) \int \frac{x^2 \left (f+g \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx-\frac{1}{2} (e g n) \int \frac{x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx\\ &=\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac{1}{2} (b n) \operatorname{Subst}\left (\int \frac{\left (-\frac{d}{e}+\frac{x}{e}\right )^2 \left (f+g \log \left (c x^n\right )\right )}{x} \, dx,x,d+e x\right )-\frac{1}{2} (g n) \operatorname{Subst}\left (\int \frac{\left (-\frac{d}{e}+\frac{x}{e}\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x} \, dx,x,d+e x\right )\\ &=\frac{1}{4} g n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{4} b n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+2 \left (\frac{1}{2} \left (b g n^2\right ) \operatorname{Subst}\left (\int \frac{x (-4 d+x)+2 d^2 \log (x)}{2 e^2 x} \, dx,x,d+e x\right )\right )\\ &=\frac{1}{4} g n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{4} b n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+2 \frac{\left (b g n^2\right ) \operatorname{Subst}\left (\int \frac{x (-4 d+x)+2 d^2 \log (x)}{x} \, dx,x,d+e x\right )}{4 e^2}\\ &=\frac{1}{4} g n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{4} b n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+2 \frac{\left (b g n^2\right ) \operatorname{Subst}\left (\int \left (-4 d+x+\frac{2 d^2 \log (x)}{x}\right ) \, dx,x,d+e x\right )}{4 e^2}\\ &=\frac{1}{4} g n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{4} b n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+2 \left (-\frac{b d g n^2 x}{e}+\frac{b g n^2 (d+e x)^2}{8 e^2}+\frac{\left (b d^2 g n^2\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,d+e x\right )}{2 e^2}\right )\\ &=2 \left (-\frac{b d g n^2 x}{e}+\frac{b g n^2 (d+e x)^2}{8 e^2}+\frac{b d^2 g n^2 \log ^2(d+e x)}{4 e^2}\right )+\frac{1}{4} g n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )+\frac{1}{4} b n \left (\frac{4 d (d+e x)}{e^2}-\frac{(d+e x)^2}{e^2}-\frac{2 d^2 \log (d+e x)}{e^2}\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac{1}{2} x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )\\ \end{align*}
Mathematica [A] time = 0.0484104, size = 263, normalized size = 1.34 \[ \frac{1}{2} a g x^2 \log \left (c (d+e x)^n\right )-\frac{a d^2 g n \log (d+e x)}{2 e^2}+\frac{a d g n x}{2 e}+\frac{1}{2} a f x^2-\frac{1}{4} a g n x^2-\frac{b d^2 g \log ^2\left (c (d+e x)^n\right )}{2 e^2}+\frac{3 b d^2 g n \log \left (c (d+e x)^n\right )}{2 e^2}+\frac{1}{2} b f x^2 \log \left (c (d+e x)^n\right )+\frac{1}{2} b g x^2 \log ^2\left (c (d+e x)^n\right )-\frac{1}{2} b g n x^2 \log \left (c (d+e x)^n\right )+\frac{b d g n x \log \left (c (d+e x)^n\right )}{e}-\frac{b d^2 f n \log (d+e x)}{2 e^2}+\frac{b d f n x}{2 e}-\frac{3 b d g n^2 x}{2 e}-\frac{1}{4} b f n x^2+\frac{1}{4} b g n^2 x^2 \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.603, size = 1558, normalized size = 8. \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05734, size = 302, normalized size = 1.54 \begin{align*} \frac{1}{2} \, b g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right )^{2} - \frac{1}{4} \, b e f n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} - \frac{1}{4} \, a e g n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} + \frac{1}{2} \, b f x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac{1}{2} \, a g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac{1}{2} \, a f x^{2} - \frac{1}{4} \,{\left (2 \, e n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) - \frac{{\left (e^{2} x^{2} + 2 \, d^{2} \log \left (e x + d\right )^{2} - 6 \, d e x + 6 \, d^{2} \log \left (e x + d\right )\right )} n^{2}}{e^{2}}\right )} b g \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.16008, size = 554, normalized size = 2.83 \begin{align*} \frac{2 \, b e^{2} g x^{2} \log \left (c\right )^{2} +{\left (b e^{2} g n^{2} + 2 \, a e^{2} f -{\left (b e^{2} f + a e^{2} g\right )} n\right )} x^{2} + 2 \,{\left (b e^{2} g n^{2} x^{2} - b d^{2} g n^{2}\right )} \log \left (e x + d\right )^{2} - 2 \,{\left (3 \, b d e g n^{2} -{\left (b d e f + a d e g\right )} n\right )} x + 2 \,{\left (2 \, b d e g n^{2} x + 3 \, b d^{2} g n^{2} -{\left (b e^{2} g n^{2} -{\left (b e^{2} f + a e^{2} g\right )} n\right )} x^{2} -{\left (b d^{2} f + a d^{2} g\right )} n + 2 \,{\left (b e^{2} g n x^{2} - b d^{2} g n\right )} \log \left (c\right )\right )} \log \left (e x + d\right ) + 2 \,{\left (2 \, b d e g n x -{\left (b e^{2} g n - b e^{2} f - a e^{2} g\right )} x^{2}\right )} \log \left (c\right )}{4 \, e^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.04438, size = 389, normalized size = 1.98 \begin{align*} \begin{cases} - \frac{a d^{2} g n \log{\left (d + e x \right )}}{2 e^{2}} + \frac{a d g n x}{2 e} + \frac{a f x^{2}}{2} + \frac{a g n x^{2} \log{\left (d + e x \right )}}{2} - \frac{a g n x^{2}}{4} + \frac{a g x^{2} \log{\left (c \right )}}{2} - \frac{b d^{2} f n \log{\left (d + e x \right )}}{2 e^{2}} - \frac{b d^{2} g n^{2} \log{\left (d + e x \right )}^{2}}{2 e^{2}} + \frac{3 b d^{2} g n^{2} \log{\left (d + e x \right )}}{2 e^{2}} - \frac{b d^{2} g n \log{\left (c \right )} \log{\left (d + e x \right )}}{e^{2}} + \frac{b d f n x}{2 e} + \frac{b d g n^{2} x \log{\left (d + e x \right )}}{e} - \frac{3 b d g n^{2} x}{2 e} + \frac{b d g n x \log{\left (c \right )}}{e} + \frac{b f n x^{2} \log{\left (d + e x \right )}}{2} - \frac{b f n x^{2}}{4} + \frac{b f x^{2} \log{\left (c \right )}}{2} + \frac{b g n^{2} x^{2} \log{\left (d + e x \right )}^{2}}{2} - \frac{b g n^{2} x^{2} \log{\left (d + e x \right )}}{2} + \frac{b g n^{2} x^{2}}{4} + b g n x^{2} \log{\left (c \right )} \log{\left (d + e x \right )} - \frac{b g n x^{2} \log{\left (c \right )}}{2} + \frac{b g x^{2} \log{\left (c \right )}^{2}}{2} & \text{for}\: e \neq 0 \\\frac{x^{2} \left (a + b \log{\left (c d^{n} \right )}\right ) \left (f + g \log{\left (c d^{n} \right )}\right )}{2} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.36509, size = 644, normalized size = 3.29 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]